import { Spin } from "antd";
import { FC } from "react";

interface LoadingScreenProps {
	className?: string;
	mask?: boolean;
}
const LoadingScreen: FC<LoadingScreenProps> = props => {
	const { className, mask } = props;
	const maskStyleObj = mask ? { backgroundColor: "rgba(0,0,0,.2)" } : {};
	return (
		<div style={{ ...maskStyleObj }} className={`flex flex-col justify-center items-center h-screen w-screen${className ? " " + className : ""}`}>
			<Spin size="large" />
			<div className="mt-3 text-gray-500 text-base text-white">加载中...</div>
		</div>
	);
};
LoadingScreen.defaultProps = {
	mask: true,
};
export default LoadingScreen;
